Skip to content

Conversation

@faisalsiddique4400
Copy link
Contributor

@faisalsiddique4400 faisalsiddique4400 commented Feb 6, 2026

feat(admin-ui): revamp MAU and Settings screens as per Figma (#2626)

Summary

This PR revamps the MAU and Settings screens in the Admin UI to align with the latest Figma designs as part of the ongoing Admin UI redesign initiative.

Changes Included

  • Updated layouts and visual styling for MAU and Settings screens.
  • Improved information hierarchy and readability.
  • Aligned components with the new Admin UI design system.
  • Ensured consistent spacing, typography, and component alignment.
  • Verified responsiveness and usability across supported screen sizes.

Result

  • Modernized and visually consistent MAU and Settings screens.
  • Improved clarity and usability for administrative workflows.
  • Better alignment with the overall Admin UI redesign effort.

Parent Initiative

This work is part of the following parent feature:
feat(admin-ui): Revamp the existing design of the admin-ui according to the new design

🔗 Ticket

Closes: #2626

Summary by CodeRabbit

Release Notes

  • New Features

    • Enhanced theming system with new form footer and settings color configurations for improved dark mode support
    • Added disableHoverStyles prop to buttons with improved color management utility
    • Added custom formatter support for chart tooltips with enhanced value formatting
  • Refactor

    • Refactored dashboard components with theme-aware styling and responsive layouts
    • Replaced form footer component with improved GluuThemeFormFooter
    • Enhanced component type safety with generic props interfaces
  • Documentation

    • Added language translations for Usage & Token Analytics feature across multiple locales
  • Style

    • Expanded theme configuration with new color tokens and button styling options

@mo-auto mo-auto added comp-admin-ui Component affected by issue or PR kind-feature Issue or PR is a new feature request labels Feb 6, 2026
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Feb 6, 2026

📝 Walkthrough

Walkthrough

This PR redesigns the MAU (Monthly Active Users) and Settings screens with comprehensive theming support, component refactoring, and UI modernization. Changes include theme-aware styling hooks, updated form/button component APIs, chart tooltip improvements, translation additions, type improvements (generic typing), color token changes, and layout restructuring across multiple dashboard and settings pages.

Changes

Cohort / File(s) Summary
Button & Form Components
admin-ui/app/components/GluuButton/GluuButton.tsx, admin-ui/app/components/GluuButton/types.ts
Added disableHoverStyles prop to GluuButton and integrated resolveBackgroundColor utility for hover logic refactoring.
Input & Toggle Rows
admin-ui/app/routes/Apps/Gluu/GluuInputRow.tsx, admin-ui/app/routes/Apps/Gluu/GluuSelectRow.tsx, admin-ui/app/routes/Apps/Gluu/GluuToogle.tsx, admin-ui/app/routes/Apps/Gluu/GluuToogleRow.tsx
Introduced generic typing (<T>), added isDark prop for theming, improved type safety with FormikProps, and enhanced error color handling via theme context.
Label Component
admin-ui/app/routes/Apps/Gluu/GluuLabel.tsx
Added isDark prop for theme-based color derivation; refactored sizing and tooltip styling logic; moved colon rendering inline.
Form Footer Components
admin-ui/app/routes/Apps/Gluu/GluuFormFooter.tsx, admin-ui/app/routes/Apps/Gluu/GluuThemeFormFooter.tsx, admin-ui/app/routes/Apps/Gluu/styles/GluuThemeFormFooter.style.ts
Completely refactored footer component with new GluuThemeFormFooter, expanded props (backIconClass, disableCancel, showApply, disableApply, applyButtonLabel, isLoading, className), theme-aware button colors, and improved layout control.
Theme Configuration & Colors
admin-ui/app/context/theme/config.ts, admin-ui/app/customColors.ts
Added comprehensive theme properties (errorColor, formFooter, settings); removed deprecated color tokens (darkSidebar, mauDark); added new tokens (addPropertyBgLight, addPropertyTextDark, customParamsBoxDark, customParamsInputDark).
MAU Page & Styles
admin-ui/plugins/admin/components/MAU/MauPage.tsx, admin-ui/plugins/admin/components/MAU/MauPage.style.ts
Restructured layout from Card-based to GluuPageContent; added dynamic date utilities (subtractDate, createDate); integrated theme-based styling via useMauStyles; replaced MauSummaryCards with computed grid-based cards.
MAU Date & Component Utilities
admin-ui/plugins/admin/components/MAU/components/DateRangeSelector.tsx, admin-ui/plugins/admin/components/MAU/utils/datePicker.ts, admin-ui/plugins/admin/components/MAU/utils/index.ts
Added themed date picker configuration via getDatePickerTextFieldSlotProps; replaced ButtonGroup with GluuButton presets; integrated flex/grid layout with theme-aware styling.
MAU Summary & Chart Components
admin-ui/plugins/admin/components/MAU/components/MauSummaryCards.tsx, admin-ui/plugins/admin/components/MAU/components/MauTrendChart.tsx, admin-ui/plugins/admin/components/MAU/components/TokenDistributionChart.tsx, admin-ui/plugins/admin/components/MAU/components/TokenTrendChart.tsx
Replaced hardcoded colors with theme-based customColors; replaced CardHeader with GluuText titles; integrated TooltipDesign with custom formatters; applied styled classes via useMauStyles.
Settings Page
admin-ui/plugins/admin/components/Settings/SettingsPage.tsx, admin-ui/plugins/admin/components/Settings/SettingsPage.style.ts
Restructured from Card/Accordion to GluuPageContent; replaced GluuFormFooter with GluuThemeFormFooter; added useStyles hook for comprehensive theming; refactored additionalParameters UI with per-parameter Add/Remove buttons; integrated theme-based error handling.
Chart Utilities & Types
admin-ui/app/routes/Dashboards/Chart/TooltipDesign.tsx, admin-ui/app/routes/Dashboards/Chart/utils.ts, admin-ui/app/routes/Dashboards/types/DashboardTypes.ts
Added formatTooltipValue utility; refactored TooltipDesign with optional formatter prop; relaxed TooltipPayloadItem types (made properties optional, widened payload type); expanded label mapping.
Button & Settings Utilities
admin-ui/app/utils/buttonUtils.ts, admin-ui/plugins/admin/helper/settings.ts
Added resolveBackgroundColor utility for button hover logic; introduced AdditionalParameterFormItem interface with UUID-based IDs for form parameter tracking.
Cedarling & MAU Configuration
admin-ui/plugins/admin/components/Cedarling/CedarlingConfigPage.tsx, admin-ui/plugins/admin/components/MAU/constants.ts, admin-ui/plugins/admin/components/MAU/hooks/useMauStats.ts
Replaced GluuFormFooter with GluuThemeFormFooter in Cedarling; updated dark theme color from mauDark to statusActive in constants; added keepPreviousData placeholder in query hook.
Translations
admin-ui/app/locales/{en,es,fr,pt}/translation.json
Added new key usage_token_analytics across all locales; normalized total_mau label ("MAU Total""MAU total"); updated config/paging translations; added Portuguese plural form for permissions_count.
Styling & Redux
admin-ui/app/styles/fonts.ts, admin-ui/app/redux/types/index.ts
Added button: '0.28px' letter-spacing token; reflowed RootState extends clause (no functional change).

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~60 minutes

Possibly related PRs

Suggested reviewers

  • duttarnab
  • moabu

Poem

🐰 Whiskers twitch with joy—the screens are new!
Buttons themed in colors bright and true,
MAU dashboards dance with charts so fine,
Settings sparkle in dark-mode shine!
With fonts and forms all neatly placed,
This UI overhaul has style and grace!

🚥 Pre-merge checks | ✅ 3 | ❌ 2
❌ Failed checks (1 warning, 1 inconclusive)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
Out of Scope Changes check ❓ Inconclusive Some changes appear tangential to the main MAU/Settings revamp: custom color token removals (darkSidebar, mauDark), button utility additions (resolveBackgroundColor), and Redux type reformatting may fall outside the stated Figma redesign scope. Verify whether token removals, button utilities, and type changes were necessary dependencies for the MAU/Settings redesign or represent separate refactoring efforts.
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The PR title clearly and concisely summarizes the main change: revamping MAU and Settings screens per Figma designs, matching the primary objective of the changeset.
Linked Issues check ✅ Passed The PR implements all key requirements from issue #2626: new layouts/styling, improved information hierarchy, component alignment with design system, and responsive design across the MAU and Settings screens.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch admin-ui-issue-2626

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 16

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (8)
admin-ui/plugins/admin/components/MAU/components/MauSummaryCards.tsx (1)

58-62: 🧹 Nitpick | 🔵 Trivial

Hardcoded color for "Total Tokens" card is inconsistent with theme-aware approach.

The other three cards pull their border color from chartColors (theme-aware), but this one uses a hardcoded '#6c757d'. Given that this PR introduces dark mode / theme-aware styling, consider sourcing this color from getChartColors as well for visual consistency across themes.

admin-ui/app/routes/Apps/Gluu/GluuLabel.tsx (1)

52-65: 🧹 Nitpick | 🔵 Trivial

color in labelStyle is effectively overridden by the <h5> inline style.

labelStyle (line 54) sets color: labelColor, but the <h5> at line 65 independently re-applies style={{ color: labelColor }}. Since the <h5> is the visible text container, the color on the parent <Label> has no visual effect on text. Additionally, the ...style spread (line 55) can override labelColor on the <Label> but never on the <h5>, creating a subtle inconsistency if a consumer passes a custom color via the style prop.

Consider either removing color from labelStyle or removing the inline color on the <h5> to keep a single source of truth.

admin-ui/app/components/GluuButton/GluuButton.tsx (1)

88-107: ⚠️ Potential issue | 🔴 Critical

disableHoverStyles missing from useMemo dependency array — stale memoized style.

disableHoverStyles is read inside the useMemo callback (Lines 54, 70) but is not listed in the dependency array. If a parent toggles disableHoverStyles at runtime, the button style will not recompute, producing stale hover behavior.

,

🐛 Proposed fix
   }, [
     sizeConfig,
     outlined,
     isHovered,
     isDisabled,
     block,
     themeColors,
     isDark,
     backgroundColor,
     textColor,
     borderColor,
     borderRadius,
     fontSize,
     fontWeight,
     padding,
     minHeight,
     useOpacityOnHover,
     hoverOpacity,
+    disableHoverStyles,
     style,
   ])
admin-ui/app/routes/Apps/Gluu/GluuFormFooter.tsx (2)

71-84: ⚠️ Potential issue | 🟠 Major

Cancel button is invisible when showBack=false, showCancel=true, showApply=true.

With this combination hasThreeButtons is false (Back is off), and hasRightGroup evaluates to false || (true && !true)false. The right group never renders, so the Cancel button is silently dropped. Apply renders in the left group, but Cancel has no placement path.

If this two-button (Apply + Cancel) layout is expected in any consumer, the condition needs adjustment.

🐛 Proposed fix
-    const hasRightGroup = hasThreeButtons || (!!showCancel && !showApply)
+    const hasRightGroup = hasThreeButtons || Boolean(showCancel)

If you also want Cancel and Apply side-by-side in the right group when Back is hidden, you may need to adjust the Apply placement logic at Line 134 accordingly.


134-148: 🧹 Nitpick | 🔵 Trivial

Duplicated Apply button markup — consider extracting to a shared variable.

The Apply <GluuButton> block is rendered identically in both the left group (Line 134) and the right group (Line 153), differing only in the wrapping condition. Extracting the button JSX into a local variable (e.g., applyButton) and placing it in the appropriate group would eliminate the duplication.

♻️ Sketch
const applyButton = buttonStates.showApply ? (
  <GluuButton
    type={applyButtonType}
    onClick={applyButtonType === 'button' ? onApply : undefined}
    disabled={disableApply || isLoading}
    loading={isLoading}
    title={applyLabel}
    backgroundColor={buttonColors.apply.backgroundColor}
    textColor={buttonColors.apply.textColor}
    borderColor={buttonColors.apply.borderColor}
    {...SHARED_BUTTON_PROPS}
  >
    {applyLabel}
  </GluuButton>
) : null

// Then in JSX:
// Left group:  {!buttonStates.hasThreeButtons && applyButton}
// Right group: {buttonStates.hasThreeButtons && applyButton}

Also applies to: 153-166

admin-ui/app/routes/Dashboards/DateRange/index.tsx (1)

38-45: ⚠️ Potential issue | 🟡 Minor

Remove the unused isDark prop from the DateRange component.

The component receives isDark as a prop (line 38, aliased as _isDark) and compares it in the memo comparator (line 282), but never uses it. The component derives dark mode from ThemeContext instead (line 45: isDarkTheme). This is dead code that should be removed from the interface, destructuring, and memo comparator.

Proposed fix
 interface DateRangeProps {
   startDate: Dayjs
   endDate: Dayjs
   onStartDateChange: (date: Dayjs | null) => void
   onEndDateChange: (date: Dayjs | null) => void
   onStartDateAccept?: (date: Dayjs | null) => void
   onEndDateAccept?: (date: Dayjs | null) => void
   textColor?: string
   backgroundColor?: string
-  isDark?: boolean
   dateFormat?: string
 }

And in the destructuring:

   ({
     startDate,
     endDate,
     onStartDateChange,
     onEndDateChange,
     onStartDateAccept,
     onEndDateAccept,
     textColor,
     backgroundColor,
-    isDark: _isDark = false,
     dateFormat = 'MM/DD/YYYY',
   }: DateRangeProps) => {

And in the memo comparator (line 282):

     startDateSame &&
     endDateSame &&
     prevProps.textColor === nextProps.textColor &&
     prevProps.backgroundColor === nextProps.backgroundColor &&
-    prevProps.isDark === nextProps.isDark &&
     prevProps.dateFormat === nextProps.dateFormat &&

Also remove the prop from the caller in DashboardPage.tsx (line 421).

admin-ui/plugins/admin/components/MAU/MauPage.tsx (1)

20-26: ⚠️ Potential issue | 🟡 Minor

Unused import: MauSummaryCards

MauSummaryCards is imported on line 22 but never referenced in the component body — the rendering now uses the summaryCards array with DashboardSummaryCard (lines 165-173). Remove it to avoid dead code.

🧹 Proposed fix
 import {
   DateRangeSelector,
-  MauSummaryCards,
   MauTrendChart,
   TokenDistributionChart,
   TokenTrendChart,
 } from './components'
admin-ui/plugins/admin/components/Settings/SettingsPage.tsx (1)

229-257: 🛠️ Refactor suggestion | 🟠 Major

Avoid extracting resetForm from Formik into a separate variable for dependency arrays.

Per the project's established pattern, extracting individual Formik methods like resetForm into separate variables and placing them in useCallback dependency arrays can cause issues with Formik's internal field registration and focus management. Use formik.resetForm directly and include formik in the dependency array instead.

♻️ Proposed fix
-  const { resetForm } = formik
-
   const isPagingSizeChanged = currentPagingSize !== baselinePagingSize
   ...

   const handleCancel = useCallback(() => {
     const resetValues = transformToFormValues(config)
-    resetForm({ values: resetValues })
+    formik.resetForm({ values: resetValues })
     setCurrentPagingSize(baselinePagingSize)
-  }, [config, transformToFormValues, baselinePagingSize, resetForm])
+  }, [config, transformToFormValues, baselinePagingSize, formik])

Based on learnings: "In React components using Formik, do not extract individual Formik methods (such as setValues, setTouched, validateForm) or properties (such as touched, errors) into separate variables/refs to use in dependency arrays. Keeping the entire formik object in the dependency array is the recommended pattern, as extracting methods separately can cause issues with form focusing and break Formik's internal field registration and focus management."

🤖 Fix all issues with AI agents
In `@admin-ui/app/components/GluuButton/GluuButton.tsx`:
- Around line 70-80: Extract the nested ternary that computes backgroundColor in
GluuButton into a small helper function (eg. resolveBackgroundColor) that
accepts the inputs disableHoverStyles, keepBgOnHover, outlined, isHovered,
isDisabled, bg, and hoverBg, implements the same branching logic, and returns
the resolved color; then replace the inline nested ternary with a single call to
resolveBackgroundColor(...) from the style so the behavior of the component
(GluuButton) is unchanged but readability is improved.

In `@admin-ui/app/customColors.ts`:
- Around line 31-36: The token name addPropertyBgLight is misleading because the
value '#132E4D' is dark; rename tokens to make theme ownership explicit (e.g.,
addPropertyBgInLightTheme or light_addPropertyBg) or add a brief comment above
these constants explaining that the Light/Dark suffix indicates the theme, not
lightness; update all references to addPropertyBgLight, addPropertyTextDark,
customParamsBoxLight, customParamsBoxDark, customParamsInputDark, and
customParamsTitleLight to the new names (or keep names but add the explanatory
comment) to avoid confusion for future maintainers.

In `@admin-ui/app/routes/Dashboards/Chart/TooltipDesign.tsx`:
- Around line 48-54: The tooltip mapping renders item values directly but
item.payload is Record<string, unknown>, so value is unknown and may be an
object causing React to throw; in the payload.map handler (where dataKey, label
and value are computed) coerce or guard value before rendering—e.g., detect
null/undefined and render an empty string, primitives as-is, and objects via
JSON.stringify or a safe formatter, and use that safe string/JSX when rendering
instead of the raw value; also make the React key unique by replacing
key={dataKey || idx} with a combined key like `${dataKey}-${idx}` to avoid
duplicate keys.

In `@admin-ui/plugins/admin/components/MAU/components/DateRangeSelector.tsx`:
- Line 65: Replace the hard-coded 'rgba(255, 255, 255, 0.12)' border color used
in DateRangeSelector's style (the borderColor assignment inside the
DateRangeSelector component) with the design token customColors.darkBorder when
isDark is true, preserving the existing conditional (isDark ? ... :
customColors.borderInput) so dark-mode borders use the shared token.
- Around line 88-117: The slotProps.textField.sx block is duplicated for the
start and end DatePickers; extract it into a shared constant (e.g.
datePickerSlotProps or datePickerSx) defined above the return in the
DateRangeSelector component and replace both slotProps references with that
constant; ensure the constant preserves size: 'small', InputLabelProps: {
shrink: true }, the sx object that references isDark and customColors, and then
use the shared identifier in both pickers (replace each slotProps.textField.sx
usage) so styling is DRY and identical for start/end pickers.

In `@admin-ui/plugins/admin/components/MAU/components/MauTrendChart.tsx`:
- Around line 53-63: The Tooltip's formatter prop in MauTrendChart is ignored
because content is provided; remove the dead formatter prop from the Tooltip
call and move the formatting logic into the TooltipDesign used by content:
update TooltipDesign props (or its render logic) to accept and apply
formatNumber to the incoming value (or accept a formatter prop passed from
MauTrendChart), so TooltipDesign displays the formatted number while still
receiving themeColors and isDark as before; reference MauTrendChart, Tooltip,
TooltipDesign, and formatNumber to locate and update the code.

In `@admin-ui/plugins/admin/components/MAU/components/TokenDistributionChart.tsx`:
- Around line 74-86: Remove the unused formatter prop from the Tooltip JSX (the
formatter={(value: number) => formatNumber(value)} on the Tooltip component)
because Recharts ignores formatter when a custom content prop is provided; keep
the content prop that renders TooltipDesign as-is. Also remove the now-unused
formatNumber import (originally imported near line 13) to avoid dead code and
unused imports. Ensure no other references to formatNumber remain before
committing.

In `@admin-ui/plugins/admin/components/MAU/components/TokenTrendChart.tsx`:
- Line 54: Replace the hardcoded CartesianGrid stroke color with a theme-derived
color so the grid adapts to dark/light modes: update the CartesianGrid in
TokenTrendChart (and the same CartesianGrid usage in MauTrendChart) to use the
appropriate value from themeColors (for example themeColors.borderColor or a
dedicated themeColors.gridColor) instead of "#e0e0e0", ensuring the component
imports/receives themeColors or accesses the theme prop used elsewhere in these
files.
- Line 20: Remove the unused import by deleting the import statement for the
symbol "customColors" in the TokenTrendChart component (the import line "import
customColors from '@/customColors'"); ensure no other code references
"customColors" in TokenTrendChart.tsx and run a quick typecheck/lint to confirm
the unused-import warning is resolved.

In `@admin-ui/plugins/admin/components/MAU/MauPage.style.ts`:
- Around line 17-20: The theme parameter in the makeStyles callback for
useMauStyles (signature currently using "theme: Theme") is unused; rename it to
_theme to indicate intentional non-use and satisfy no-unused-vars linting.
Update the callback parameter list in the makeStyles<MauStylesParams>() function
(the same location where { themeColors, isDark } is destructured) to use _theme:
Theme instead of theme: Theme.

In `@admin-ui/plugins/admin/components/MAU/MauPage.tsx`:
- Around line 133-144: Replace the inline style on the wrapper div around
DateRangeSelector with a Bootstrap utility class for spacing: remove style={{
marginBottom: 24 }} and add className="mb-4" on the div that contains
<DateRangeSelector ... /> (the component and handlers like DateRangeSelector,
handleStartDateChange, handleEndDateChange, handlePresetSelect, handleApply
remain unchanged).

In `@admin-ui/plugins/admin/components/Settings/SettingsPage.style.ts`:
- Around line 63-73: Replace the hardcoded '#0A2540' color with the design token
customColors.primaryDark in the SettingsPage.style.ts style objects (e.g., in
the settingsLabels rule and the other similar block referenced in the review) so
color usage matches headerTitle; update any style entries that currently use
'#0A2540' to use customColors.primaryDark and ensure customColors is
imported/available in the module.
- Around line 176-181: The focus rule in SettingsPage.style.ts currently removes
visible focus (selector '&:focus' sets outline: 'none' and a transparent
border), breaking keyboard accessibility; change the '&:focus' block in the
SettingsPage.style.ts (where isDark and customColors are used) to remove
outline: 'none' and transparent border and instead apply a visible,
high-contrast focus indicator — for example set a non-transparent borderColor
(use customColors.primaryDark or a dedicated customColors.focus) and/or add a
boxShadow like `0 0 0 3px rgba(...)` that adapts to isDark so keyboard users can
see focus while preserving the existing backgroundColor/color logic.

In `@admin-ui/plugins/admin/components/Settings/SettingsPage.tsx`:
- Around line 497-534: The map over formik.values.additionalParameters currently
uses the array index as the React key (in the JSX mapping that renders the
Inputs and GluuButton), which breaks when items are spliced; instead add a
stable unique id to each parameter object when creating a new entry (e.g., set
id: crypto.randomUUID() on push into formik.values.additionalParameters) and
change the map to use that id as the key; update the removal handler (the
onClick that currently does splice by index) to remove by id (e.g., filter out
the item with matching id) and then call
formik.setFieldValue('additionalParameters', newArray) so React can correctly
track items and avoid focus/stale-state bugs.
- Around line 4-5: Replace the untyped import/use of useDispatch with the typed
useAppDispatch to ensure type-safe dispatching: change the import from
useDispatch (react-redux) to useAppDispatch from '@/redux/hooks' and update any
references to useDispatch() (e.g., dispatch = useDispatch()) to useAppDispatch()
in SettingsPage.tsx alongside the existing useAppSelector usage.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 13

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (4)
admin-ui/app/components/GluuButton/GluuButton.tsx (1)

87-106: ⚠️ Potential issue | 🔴 Critical

Missing disableHoverStyles in useMemo dependency array — stale styles.

disableHoverStyles is used inside the memo (Lines 55, 71-79) but is not listed in the dependency array. If a parent toggles disableHoverStyles after initial render, the button style will not recompute, leaving stale hover behavior.

🐛 Proposed fix
   }, [
     sizeConfig,
     outlined,
     isHovered,
     isDisabled,
     block,
     themeColors,
     isDark,
     backgroundColor,
     textColor,
     borderColor,
     borderRadius,
     fontSize,
     fontWeight,
     padding,
     minHeight,
     useOpacityOnHover,
     hoverOpacity,
+    disableHoverStyles,
     style,
   ])
admin-ui/plugins/admin/components/Settings/SettingsPage.tsx (1)

228-228: 🧹 Nitpick | 🔵 Trivial

Extracted resetForm from formik may cause subtle issues.

Per a prior learning on this codebase: extracting individual Formik methods (like resetForm) into separate variables and using them in dependency arrays can cause issues with Formik's internal field registration and focus management. Consider using formik.resetForm directly in handleCancel and including formik in the dependency array instead.

♻️ Proposed fix
- const { resetForm } = formik
-
  ...
  const handleCancel = useCallback(() => {
    const resetValues = transformToFormValues(config)
-   resetForm({ values: resetValues })
+   formik.resetForm({ values: resetValues })
    setCurrentPagingSize(baselinePagingSize)
- }, [config, transformToFormValues, baselinePagingSize, resetForm])
+ }, [config, transformToFormValues, baselinePagingSize, formik])

Based on learnings: "In React components using Formik, do not extract individual Formik methods (such as setValues, setTouched, validateForm) or properties into separate variables/refs to use in dependency arrays. Keeping the entire formik object in the dependency array is the recommended pattern."

Also applies to: 252-256

admin-ui/plugins/admin/components/MAU/components/TokenTrendChart.tsx (1)

38-43: 🧹 Nitpick | 🔵 Trivial

Consider memoizing chartData.

The data.map(...) transform runs on every render. While unlikely to be a bottleneck for typical MAU datasets (~12 entries), wrapping it in useMemo would be consistent with the chartColors memoization on Line 36 and avoid unnecessary re-computation when unrelated state changes trigger re-renders.

♻️ Proposed refactor
-  const chartData = data.map((entry) => ({
-    monthLabel: formatMonth(entry.month),
-    clientCredentials: entry.client_credentials_access_token_count,
-    authzCodeAccess: entry.authz_code_access_token_count,
-    authzCodeId: entry.authz_code_idtoken_count,
-  }))
+  const chartData = useMemo(
+    () =>
+      data.map((entry) => ({
+        monthLabel: formatMonth(entry.month),
+        clientCredentials: entry.client_credentials_access_token_count,
+        authzCodeAccess: entry.authz_code_access_token_count,
+        authzCodeId: entry.authz_code_idtoken_count,
+      })),
+    [data],
+  )
admin-ui/plugins/admin/components/MAU/MauPage.tsx (1)

20-26: ⚠️ Potential issue | 🟡 Minor

MauSummaryCards is imported but never used.

The component was replaced by DashboardSummaryCard (Line 13), but the old import on Line 22 was not removed.

Proposed fix
 import {
   DateRangeSelector,
-  MauSummaryCards,
   MauTrendChart,
   TokenDistributionChart,
   TokenTrendChart,
 } from './components'
#!/bin/bash
# Verify MauSummaryCards is not referenced anywhere else in MauPage.tsx
rg -n 'MauSummaryCards' admin-ui/plugins/admin/components/MAU/MauPage.tsx
🤖 Fix all issues with AI agents
In `@admin-ui/app/customColors.ts`:
- Around line 34-39: Remove the two unused color tokens customParamsBoxLight and
customParamsTitleLight from admin-ui/app/customColors.ts; locate the object
where addPropertyBgLight, addPropertyTextDark, customParamsBoxDark, and
customParamsInputDark are defined and delete the entries for
customParamsBoxLight and customParamsTitleLight, then run a repo-wide search to
confirm no remaining references and update any exports if necessary.

In `@admin-ui/app/routes/Dashboards/Chart/TooltipDesign.tsx`:
- Around line 19-27: TooltipDesign currently hardcodes MAU/chart-specific keys
in the internal labelMap which bloats a shared component; refactor TooltipDesign
to accept an optional prop (e.g., labelMap?: Record<string,string> or
labelFormatter?: (key:string)=>string) and default to the current map if none
provided, update the TooltipDesign component signature and its consumers to pass
custom maps/formatters when needed, and add/adjust the DashboardTypes (or
component props interface) to declare the new optional prop so consumers can
override labels without editing TooltipDesign's internal labelMap.

In `@admin-ui/app/utils/buttonUtils.ts`:
- Around line 14-18: The current hovered outlined color uses string
concatenation `${bg}15`, which only works for 6‑digit hex; update the outlined
hover branch (the code using the variables outlined, isHovered, isDisabled, and
bg) to use a proper alpha utility instead of appending "15" — import alpha from
'@mui/system' (or your project's alpha helper) and return alpha(bg, 0.08) when
isHovered && !isDisabled; keep the existing transparent return for non-hovered
outlined state.

In `@admin-ui/plugins/admin/components/MAU/components/DateRangeSelector.tsx`:
- Around line 37-48: The inline style object passed to the GluuText component in
DateRangeSelector.tsx is recreated on every render; extract that object into a
stable value (either as a module-level constant like HEADING_STYLE or memoize it
with useMemo) and replace the inline literal in the GluuText style prop so the
same object reference is reused across renders; update the GluuText call that
currently supplies the literal style to use the new constant or memoized
variable.
- Around line 53-77: The inline borderRadius in each GluuButton inside
ButtonGroup is overriding grouped styling and breaking the connected appearance;
update the DateRangeSelector by removing the borderRadius from the inline style
passed to GluuButton (locate the map over DATE_PRESETS using GluuButton,
onPresetSelect and selectedPreset) so ButtonGroup can apply its default corner
clipping, or if you intend independent pill buttons replace ButtonGroup with a
simple flex container and keep borderRadius there instead.

In `@admin-ui/plugins/admin/components/MAU/components/MauTrendChart.tsx`:
- Around line 53-65: The current cast (props as React.ComponentProps<typeof
TooltipDesign>) spreads all Recharts callback props into TooltipDesign; narrow
this by picking only the fields TooltipDesign actually uses inside the content
renderer: in the Tooltip content prop, replace the broad cast with a typed
extraction or Pick of the specific props (e.g., create a local type alias for
the subset of Recharts props you need and map props to that shape) and pass only
those into TooltipDesign; update references to Tooltip, TooltipDesign, and
TooltipDesignProps in MauTrendChart.tsx so unrelated fields like
label/coordinate/viewBox are not forwarded.

In `@admin-ui/plugins/admin/components/MAU/components/TokenDistributionChart.tsx`:
- Around line 21-29: Extract the duplicated theme logic into a small hook (e.g.,
useMauTheme) that calls getThemeColor(state.theme), derives isDark (state.theme
=== THEME_DARK), and returns the compact themeColors object { cardBg:
themeColors.dashboard.supportCard ?? themeColors.menu.background, text:
themeColors.fontColor } plus isDark; then replace the inline logic in
TokenDistributionChart, TokenTrendChart and MauPage.tsx with calls to
useMauTheme and pass its themeColors/isDark result into useMauStyles to keep
behavior identical (refer to getThemeColor, THEME_DARK, useMauStyles, and the
components TokenDistributionChart/TokenTrendChart/MauPage).

In `@admin-ui/plugins/admin/components/MAU/MauPage.tsx`:
- Around line 107-111: handlePresetSelect calls createDate() twice causing
potential clock-skew; capture a single now = createDate() once inside
handlePresetSelect and use that same now when computing startDate via
subtractDate(now, months, 'months') and when calling setEndDate(now), then call
setSelectedPreset(months); update the function (handlePresetSelect) to use the
single now variable so both start and end use the identical timestamp.
- Around line 162-176: summaryCards currently uses translated text as the React
key (key={card.text}) which is unstable across locales; update the data in
summaryCards to include a stable identifier (e.g., id) and change the JSX in
MauPage to use that stable id for the key (e.g., key={card.id}), falling back to
index only if no id exists; update any creator of summaryCards so each card
object includes a unique id and leave DashboardSummaryCard and mauClasses usage
unchanged.
- Around line 35-59: The dashboardThemeColors object adds unused properties
statusCardBg and statusCardBorder which are never consumed; remove those
properties so dashboardThemeColors only contains the baseColors and any values
actually used (cardBg, cardBorder, text, textSecondary), and ensure the call to
useMauStyles still passes the expected themeColors ({ cardBg:
dashboardThemeColors.cardBg, text: dashboardThemeColors.text }) without the dead
fields; update any related references to dashboardThemeColors, statusCardBg, or
statusCardBorder to use the existing cardBg/cardBorder fields or remove them if
unused.

In `@admin-ui/plugins/admin/components/Settings/SettingsPage.style.ts`:
- Around line 165-182: The placeholder color in the customParamsInput style is
currently set to the same color as input text in dark mode; update the
'&::placeholder' rule inside customParamsInput to use customColors.textMutedDark
when isDark is true (keep existing light-mode placeholder color) so the
placeholder appears visually muted relative to the input text; edit the
customParamsInput block referenced above to replace customColors.white with
customColors.textMutedDark for the dark-mode placeholder.

In `@admin-ui/plugins/admin/components/Settings/SettingsPage.tsx`:
- Line 497: Replace the inline type annotation "(param: { id: string; key?:
string; value?: string }, index: number)" in the arrow callback with the
imported AdditionalParameterFormItem type (i.e., use "(param:
AdditionalParameterFormItem, index: number)"), and add an import for
AdditionalParameterFormItem from the helper module where it’s defined; this
removes the duplicated shape and keeps the component in sync with the
AdditionalParameterFormItem interface.

In `@admin-ui/plugins/admin/helper/settings.ts`:
- Line 43: Replace uses of crypto.randomUUID() with the project's uuidv4()
utility and import it from the Util module; specifically, update the object
construction that sets id: crypto.randomUUID() in the helper (function/constant
where id is assigned) and the occurrence inside the SettingsPage component
(component/method around the id assignment at the settings creation). Ensure you
add an import for uuidv4 from the common Util utility and call uuidv4() in place
of crypto.randomUUID() so it falls back to crypto.getRandomValues() in
non-secure contexts.

Copy link
Contributor

@duttarnab duttarnab left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. The labels are missing in most of the forms
Image
  1. Please also check other inconsistencies raised in GH issue #2647

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 17

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (5)
admin-ui/plugins/admin/components/MAU/components/TokenTrendChart.tsx (1)

38-43: 🧹 Nitpick | 🔵 Trivial

chartData is recomputed on every render — consider memoizing.

chartColors on line 36 is memoized with useMemo, but chartData (which maps over the entire data array) is not. For consistency and to avoid unnecessary re-renders of the chart, wrap it in useMemo.

Proposed fix
- const chartData = data.map((entry) => ({
-   monthLabel: formatMonth(entry.month),
-   clientCredentials: entry.client_credentials_access_token_count,
-   authzCodeAccess: entry.authz_code_access_token_count,
-   authzCodeId: entry.authz_code_idtoken_count,
- }))
+ const chartData = useMemo(
+   () =>
+     data.map((entry) => ({
+       monthLabel: formatMonth(entry.month),
+       clientCredentials: entry.client_credentials_access_token_count,
+       authzCodeAccess: entry.authz_code_access_token_count,
+       authzCodeId: entry.authz_code_idtoken_count,
+     })),
+   [data],
+ )
admin-ui/app/routes/Apps/Gluu/GluuInputRow.tsx (2)

58-64: ⚠️ Potential issue | 🟡 Minor

Typo: setVisivilitysetVisibility.

Proposed fix
-  const setVisivility = (): void => {
+  const setVisibility = (): void => {
     if (customType) {
       setCustomType(null)
     } else {
       setCustomType('text')
     }
   }

Also update the call sites on lines 101 and 103:

-              <Visibility onClick={() => setVisivility()} />
+              <Visibility onClick={() => setVisibility()} />
             ) : (
-              <VisibilityOff onClick={() => setVisivility()} />
+              <VisibilityOff onClick={() => setVisibility()} />

98-104: 🧹 Nitpick | 🔵 Trivial

Use strict equality (===) instead of loose equality (==).

Lines 98 and 100 use == for string comparisons. While it works here since both sides are strings, strict equality is the idiomatic choice in TypeScript.

Proposed fix
-        {type == 'password' && (
+        {type === 'password' && (
           <div style={{ position: 'absolute', right: 20, top: 7 }}>
-            {customType == 'text' ? (
+            {customType === 'text' ? (
admin-ui/plugins/admin/components/Settings/SettingsPage.tsx (1)

203-203: ⚠️ Potential issue | 🟠 Major

Avoid extracting resetForm from Formik — use formik directly.

Extracting resetForm from formik (line 203) and placing it in the handleCancel dependency array (line 231) can cause issues with Formik's internal field registration and focus management. Use formik.resetForm directly instead.

Proposed fix
-  const { resetForm } = formik
-
   ...

   const handleCancel = useCallback(() => {
     const resetValues = transformToFormValues(config)
-    resetForm({ values: resetValues })
+    formik.resetForm({ values: resetValues })
     setCurrentPagingSize(baselinePagingSize)
-  }, [config, transformToFormValues, baselinePagingSize, resetForm])
+  }, [config, transformToFormValues, baselinePagingSize, formik])

Based on learnings, in React components using Formik, do not extract individual Formik methods (such as setValues, setTouched, validateForm) or properties into separate variables/refs to use in dependency arrays. Keeping the entire formik object in the dependency array is the recommended pattern.

Also applies to: 227-231

admin-ui/app/routes/Apps/Gluu/GluuFormFooter.tsx (1)

84-88: ⚠️ Potential issue | 🟡 Minor

Cancel button is a no-op when onCancel is not provided.

Unlike the Back button (which falls back to dashboard navigation), the Cancel button does nothing if onCancel is omitted. If showCancel is true without onCancel, the user sees a button that silently ignores clicks. Consider either requiring onCancel when showCancel is true (via a discriminated union similar to the Apply button pattern), or adding a sensible fallback.

🤖 Fix all issues with AI agents
In `@admin-ui/app/context/theme/config.ts`:
- Around line 54-60: The cancel color config currently mixes colors and a
behavioral flag (cancel { backgroundColor, textColor, borderColor, outlined }),
so remove the outlined boolean from the color token object and move it into a
component/style-level variant (e.g., ButtonVariants or a separate buttonStyle
config) so color tokens only contain colors; update the consumers of the cancel
token to read the new flag from the component/variant (e.g.,
ButtonConfig.cancelVariant.outlined or ButtonProps.variant = 'outlined') and
ensure any other similar entries (the other instance around the 125-131 area)
are refactored the same way so behavior flags live with rendering logic, not in
the color token objects.
- Around line 42-71: Remove the duplicated errorColor definition inside the
settings object and rely on the top-level errorColor (symbol: errorColor) to
avoid divergence; update consumers to reference the top-level errorColor (or
delete the nested settings.errorColor entry) so only the top-level errorColor is
the single source of truth for both themes (locate the settings object and
top-level errorColor in the theme config to make this change).

In `@admin-ui/app/customColors.ts`:
- Around line 30-33: The token name addPropertyBgLight is misleading because its
value (`#132E4D`) is a dark color; rename the token to addPropertyBgDark in
customColors.ts (replacing addPropertyBgLight) and update all references (e.g.,
where the light theme references it in theme/config.ts) to use
addPropertyBgDark, or if the dark color is intentional for the light theme
instead add an inline comment next to addPropertyBgLight clarifying the intent;
ensure you also update any exported typings or usages so names remain consistent
(check references to addPropertyBgLight, addPropertyTextDark,
customParamsBoxDark, customParamsInputDark).

In `@admin-ui/app/locales/pt/translation.json`:
- Around line 817-819: Remove the invalid base key "permissions_count" (which
contains ICU-style plural syntax inside i18next interpolation) from the locale
files and keep only the correct i18next plural keys "permissions_count_one" and
"permissions_count_other"; search for the keys permissions_count,
permissions_count_one, and permissions_count_other in the translation JSONs and
delete the base permissions_count entry so i18next will use the existing
suffixed plural keys.

In `@admin-ui/app/routes/Apps/Gluu/GluuFormFooter.tsx`:
- Around line 114-135: The current buttonLayout useMemo composes class strings
by manual concatenation (see buttonLayout and buttonStates usage) which is
fragile; replace the string-building with a class-composition utility (e.g.,
clsx or classnames) to build back/cancel/apply classes based on
buttonStates.showBack, showCancel, showApply, hasAllThreeButtons, and
hasAnyButton, and update imports to include the chosen utility; ensure you
construct each class with boolean conditionals (e.g., clsx('d-flex', {
'ms-auto': ..., 'me-0': ... })) so spacing and edge cases are handled cleanly.
- Around line 90-103: Remove the unused derived state hasBackAndCancel from the
useMemo in GluuFormFooter: delete the hasBackAndCancel constant and remove it
from the returned object inside the buttonStates computation (the useMemo that
references showBack, showCancel, showApply). Ensure no other code in the
component references hasBackAndCancel (e.g., buttonLayout or JSX); if any
references exist, update them to use the existing
hasAnyButton/hasAllThreeButtons flags instead.
- Line 105: The fallback theme uses an invalid literal causing buttonColor to
become "primary-darkBlack"; update the selectedTheme computation to use the
existing DEFAULT_THEME constant (which is 'dark') instead of the hardcoded
'darkBlack' so that useMemo for selectedTheme (and subsequently buttonColor)
always yields a valid theme value; locate the selectedTheme definition near
buttonColor in GluuFormFooter.tsx and replace the fallback with DEFAULT_THEME
(importing DEFAULT_THEME from the theme constants if not already imported).

In `@admin-ui/app/routes/Apps/Gluu/GluuLabel.tsx`:
- Line 76: The inline tooltip style object is recreated each render; extend the
existing tooltipStyle memo to compute and return the full style (e.g.,
fullTooltipStyle = useMemo(() => ({ zIndex: 101, maxWidth: '45vw',
...tooltipStyle }), [tooltipStyle]) ) and then use that memoized
fullTooltipStyle in the JSX instead of { zIndex: 101, maxWidth: '45vw',
...tooltipStyle }; update references in GluuLabel to use fullTooltipStyle
similarly to how labelStyle is memoized.

In `@admin-ui/app/routes/Apps/Gluu/GluuThemeFormFooter.tsx`:
- Around line 138-152: The apply button JSX is duplicated in the leftGroup and
rightGroup; extract a reusable helper (e.g., renderApplyButton) that returns the
GluuButton configured with applyButtonType, onApply, disableApply, isLoading,
applyLabel, buttonColors.apply and SHARED_BUTTON_PROPS, and replace both
duplicated blocks with {buttonStates.showApply && renderApplyButton()}; ensure
the helper respects the conditional on applyButtonType (only set onClick when
type==='button') and preserves loading/disabled/title props so behavior remains
identical.
- Around line 107-112: Replace the unnecessary useMemo wrappers for simple
string fallbacks: remove useMemo usage around backLabel, cancelLabel, and
applyLabel and define them as plain const variables (e.g., const backLabel =
backButtonLabel || t('actions.back')) so you eliminate the memoization overhead;
update occurrences that reference these symbols and remove the associated
dependency arrays and imports if useMemo is no longer used in
GluuThemeFormFooter.tsx.

In `@admin-ui/app/routes/Apps/Gluu/styles/GluuThemeFormFooter.style.ts`:
- Around line 41-49: The getButtonColors function unnecessarily recreates an
object from colors.formFooter; simplify by returning colors.formFooter directly
(i.e., replace the object literal with return colors.formFooter) and ensure the
return type of getButtonColors matches the type of formFooter from getThemeColor
so no type mismatch occurs; keep references to the same symbols:
getButtonColors, getThemeColor, and formFooter.

In `@admin-ui/plugins/admin/components/MAU/components/DateRangeSelector.tsx`:
- Line 34: getDatePickerTextFieldSlotProps(isDark) returns a new object each
render causing unnecessary re-renders when passed as slotProps to the two
DatePicker components; wrap the call that assigns datePickerTextFieldSlotProps
in React.useMemo (with isDark as the dependency) so the object reference is
stable across renders, and ensure useMemo is imported/available in the
DateRangeSelector component.
- Around line 121-128: The inline style object passed in the DateRangeSelector
component for the "View" button (the object containing minWidth, borderRadius,
fontFamily, fontStyle, lineHeight, letterSpacing) is recreated on every render;
extract this literal into a module-level constant (e.g., BUTTON_VIEW_STYLE or
VIEW_BUTTON_STYLE) and replace the inline object in the JSX with that constant
to avoid unnecessary allocations and match the title-style extraction pattern
used elsewhere in the file.

In `@admin-ui/plugins/admin/components/MAU/components/MauSummaryCards.tsx`:
- Line 73: The total_tokens card in MauSummaryCards.tsx uses a hardcoded
customColors.textSecondary for its accent, which is not theme-aware; update the
component to use a theme-aware value by pulling the token accent from
CHART_COLORS_BY_THEME (or chartColors) instead of customColors.textSecondary,
and add a dedicated token color entry to CHART_COLORS_BY_THEME (e.g., token or
totalTokens) so the card accent follows light/dark themes consistently; update
any references in MauSummaryCards.tsx to use that new key.

In `@admin-ui/plugins/admin/components/MAU/components/TokenTrendChart.tsx`:
- Around line 59-68: The Tooltip content callback in TokenTrendChart (and
similarly in MauTrendChart and TokenDistributionChart) currently casts props to
React.ComponentProps<typeof TooltipDesign>, which masks mismatches between
Recharts' tooltip props and TooltipDesignProps; update the implementation to
avoid the unsafe cast by either (a) creating a union/extended type (e.g., extend
TooltipDesignProps with Recharts' Tooltip payload props like label, position,
viewBox, coordinate) and use that as the prop type for TooltipDesign, or (b)
type the content callback with Recharts' TooltipProps and explicitly pick/pass
only the expected props into <TooltipDesign /> (e.g., extract backgroundColor,
textColor, isDark and any needed fields) without an as-cast; apply the same
change in TokenTrendChart, MauTrendChart, and TokenDistributionChart to preserve
type safety.

In `@admin-ui/plugins/admin/components/MAU/constants.ts`:
- Around line 31-32: The MAU dark-theme mapping uses customColors.statusActive
for the chart accent which couples status indicator styling with chart color;
add a new color token (e.g., customColors.mauAccentDark) in the color tokens
file and initialize it to the same hex as statusActive, then update the
THEME_DARK entry in this file (the mau key) to use customColors.mauAccentDark
instead of customColors.statusActive so chart and status colors are decoupled.

In `@admin-ui/plugins/admin/components/Settings/SettingsPage.style.ts`:
- Around line 75-85: Replace hardcoded font size and weight in the
settingsLabels style: instead of '15px' use a design-system fontSizes value
(choose fontSizes.base for 14px or fontSizes.md for 16px) and replace numeric
600 with fontWeights.semiBold; update the selector under settingsLabels (the
rule targeting '& label, & label h5, & label .MuiSvgIcon-root') to reference
fontSizes and fontWeights constants while keeping existing references to
themeColors.fontColor, fontFamily, and letterSpacing.normal.

@sonarqubecloud
Copy link

sonarqubecloud bot commented Feb 9, 2026

Copy link
Contributor

@duttarnab duttarnab left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The comments under #2647 are pending.

@moabu moabu merged commit e3333ce into main Feb 9, 2026
7 checks passed
@moabu moabu deleted the admin-ui-issue-2626 branch February 9, 2026 10:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp-admin-ui Component affected by issue or PR kind-feature Issue or PR is a new feature request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat(admin-ui) revamp the MAU and Setting screens as per figma

4 participants